package cn.edu.lcu.cs.javateaching.loop;

import java.io.*;

public class show {

	public static void main(String[] args) throws IOException {

		String key = "123456";

		BufferedReader game = new BufferedReader(new InputStreamReader(System.in));
		int i = 0;
		while (true) {
			i++;
			if (i > 5) {
				System.out.println("游戏结束");
				break;
			}
			System.out.println("请玩家输入密码:");
			String str = game.readLine();

			if (str.equals(key)) {
				System.out.println("恭喜你进入游戏");
				break;
			} else {
				System.out.println("密码错误");
				continue;
			}

		}
		game.close();

	}
}
